// http://82.157.146.153:8090/wx/catalog/index
// http://82.157.146.153:8090/wx/catalog/current?id=1005001

import request from '@/util/request.js'
// 分类左侧导航栏
export const classificationAjax = () => {
  return request({
    url: '/catalog/index',
    method: 'GEt'
  })
}
// 分类右侧内容详情
export const itemAjax = (id) => {
  return request({
    url: `/catalog/current?id=${id}`,
    method: 'GET'
  })
}
// 每个商品详情
// http://82.157.146.153:8090/wx/goods/category?id=1008002
export const categoryItemAjax = (id) => {
  return request({
    url: `goods/category?id=${id}`,
    method: 'GET'
  })
}
// 商品列表
// http://82.157.146.153:8090/wx/goods/list?categoryId=1008002&page=1&limit=10
export const categoryListAjax = ({ id, page, limit }) => {
  return request({
    url: `goods/list?categoryId=${id}&page=${page}&limit=${limit}`,
    method: 'GET'
  })
}
// 商品列表详情
// http://82.157.146.153:8090/wx/goods/detail?id=1064006
export const detailAjax = (id) => {
  return request({
    url: `goods/detail?id=${id}`,
    method: 'GET'
  })
}
// 加入购物车
// http://82.157.146.153:8090/wx/cart/add
export const addShopAjax = (options) => {
  return request({
    url: '/cart/add',
    method: 'POST',
    data: options
  })
}
